<template>
  <scroller>
    <div class="speed">
    <!--  -->
    <div class="con">
      <div class="con-c">
        <div class="title">
          <p>{{taskInfo['actAllot.allotNumber']}}</p>
          <span>{{taskInfo['actApply.actNode']}}</span>
        </div>
        <div class="detail">
          <p style="color: #4A82C6;">{{taskInfo['actApply.actNode']}}</p>
          <div class="detail-l">
            <p>调拨类型：</p>
            <span>外部调拨</span>
            <p>是否可调拨：</p>
            <span>是</span>
          </div>
          <div class="detail-r">
            <p>任务接收人：</p>
            <span>{{taskInfo['actApply.applyUser.name']}}</span>
          </div>
        </div>
      </div>
    </div>
    <!--  -->
    <div class="flow">
      <ul class="flow-list">
        <li class="flow-item" v-for="item in list" :key="item.id">
          <span class="label">
            <i class="icon fa fa-check"></i>
          </span>
          <div class="flow-item-wrap">
            <p>{{item.taskName}}</p>
            <p>执行人：{{item.assigneeName}}</p>
            <p>执行日期：{{item.proStartTime | format('YYYY-MM-DD')}}</p>
            <p>处理意见：{{item.comment}}</p>
          </div>
        </li>
      </ul>
    </div>
    </div>
  </scroller>
</template>

<script>
import { mapGetters } from 'vuex'
import { Loadmore } from 'mint-ui'

export default {
  name: 'ActApplySpeed',
  components: {
    Loadmore
  },
  computed: {
    ...mapGetters({
      taskInfo: 'task/info'
    })
  },
  props: {
    list: {
      type: Array,
      default: () => ([])
    }
  },
  data () {
    return {
    }
  },
  methods: {
    go () {
      var $router = this.$router
      $router.push('turetype')
    },
    loadTop () {
      //  加载更多数据
      this.$refs.loadmore.onTopLoaded()
    }
  }
}
</script>

<style lang="scss" scoped>
.speed {
  height: 100%;
  padding: 1rem;
  background: #eaeeef;

  .con {
    min-height: 8rem;
    background: #fff;
    border-radius: 6px;

    .con-c {
      padding: 0.5rem;
      overflow: hidden;
    }
    .title {
      height: 2rem;
      font-size: 0.8rem;
      border-bottom: 1px dashed #d4d4d4;
    }
    .title p {
      line-height: 2rem;
      float: left;
    }
    .title span {
      line-height: 2rem;
      float: right;
      color: #f5af41;
    }
    .detail {
      font-size: 0.8rem;
      line-height: 1.8rem;
    }
    .detail-l {
      width: 50%;
      float: left;
    }
    .detail-r {
      width: 50%;
      float: left;
    }
    .detail-l p {
      display: inline-block;
    }
    .detail-r p {
      display: inline-block;
    }
  }

  .flow {
    overflow: hidden;
    .flow-list {

      .flow-item {
        margin-left: 3rem;
        padding: 0.8rem 0;
        position: relative;

        &:before {
          content: '';
          position: absolute;
          left: -1.48rem;
          width: 1px;
          background: #bfbfbf;
          top: 0;
          bottom: 0;
        }

        &:first-child {
          &:before {
            top: 45%;
            bottom: 0;
          }
        }

        &:last-child {
          &:before {
            top: 0;
            bottom: 55%;
          }
          .label {
            background: #e51c23;
            &:after {
              content: '';
              position: absolute;
              top: 50%;
              left: 50%;
              width: 0.8rem;
              height: 0.8rem;
              margin-top: -0.4rem;
              margin-left: -0.4rem;
              border-radius: 50%;
              background: #ffffff;
              vertical-align: middle;
            }
            .icon {
              display: none;
            }
          }
        }


        .label {
          position: absolute;
          width: 1rem;
          height: 1rem;
          line-height: 1rem;
          top: 45%;
          left: -2rem;
          background: #8bc34a;
          border-radius: 50%;
          font-size: 0.8rem;
          color: #ffffff;
          text-align: center;
        }

        .flow-item-wrap {
          padding: 0.5rem;
          background: #fff;
          border-radius: 6px;
          font-size: 0.8rem;
          line-height: 1.8rem;
        }
      }
    }
  }
}
</style>
